String clazzTpl({package}) => """
// ignore_for_file: constant_identifier_names
import 'package:flutter/material.dart';
import 'package:$package/debug/main.dart';
import 'package:$package/debug/app_debug.dart';
import 'package:$package/utils/screen_util.dart';
import 'package:$package/debug/app_error_log.dart';
import 'package:$package/pages/main/main_page.dart';

/// Generates Dart code
GlobalKey<NavigatorState> globalNavigatorKey = GlobalKey();

///路由表url名称
class RouteConstant {
  ///自动生成，误自己添加
  /// 入口页面
  static const String MainPage = '/';
  /// debug页面
  static const String DebugMainPage = '/debug';
  static const String AppDebugPage = '/appDebug';
  static const String AppErrorContentLogPage = '/appErrorContentLog';
  static const String AppErrorLogPage = '/appErrorLog';

}

///通过 routeName名称 返回 Widget的名称
String routeWidgetName(String routeName) {
  ///自动生成，误自己添加
  var defaultRouteName = 'MainPage';
  var map = {
    RouteConstant.MainPage: 'MainPage',
    RouteConstant.DebugMainPage: 'DebugMainPage',
    RouteConstant.AppDebugPage: 'AppDebugPage',
    RouteConstant.AppErrorContentLogPage: 'AppErrorContentLogPage',
    RouteConstant.AppErrorLogPage: 'AppErrorLogPage',

  };
  return map.containsKey(routeName) ? map[routeName]! : defaultRouteName;
}

///路由表  部分title不是页面需要，但是必填是为了直观查看
Map<String, WidgetBuilder> routes(BuildContext? context) {
  ///自动生成，误自己添加
  return {
    RouteConstant.MainPage: (context) {
      ScreenSizeFit.init(context);
      return const MainPage(title: 'main');
    },
    RouteConstant.DebugMainPage: (context) => const DebugMainPage(title: 'debug-route'),
    RouteConstant.AppDebugPage: (context) => const AppDebugPage(title: 'AppDebug'),
    RouteConstant.AppErrorLogPage: (context) => const AppErrorLogPage(title: 'AppErrorLog'),

  };
}

///无Context跳转
mixin RouteNavigator implements Navigator {
  static Future<T?> pushNamed<T extends Object>(String routeName,
      {Object? arguments}) {
    return globalNavigatorKey.currentState!
        .pushNamed<T>(routeName, arguments: arguments);
  }
}
""";
